/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package au.csiro.nt.psdp.dao;

/**
 *
 * @author Administrator
 */
import org.appfuse.dao.GenericDao;
import org.springframework.transaction.annotation.Transactional;
import org.acegisecurity.userdetails.UserDetails;
import org.acegisecurity.userdetails.UsernameNotFoundException;

import java.util.List;

import au.csiro.nt.psdp.model.User;

/**
 *
 */
public interface UserDao extends GenericDao<User, Long>
{
    /**
     * Gets users information based on login name.
     * @param username the user's username
     * @return userDetails populated userDetails object
     */
    @Transactional
    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException;

    /**
     * Gets a list of users ordered by the uppercase version of their username.
     *
     * @return List populated list of users
     */
    public List<User> getUsers();
    public List<User> getUsers(String userName);
    public List<User> getInstructors();
    /**
     * Saves a user's information.
     * @param user the object to be saved
     */
    public User saveUser(User user);

    public void removeUser(User user);

}
